From: Antoine Musso Date: Tue, 1 Feb 2005 00:35:28 +0000 (+0000) Subject: Fix #913 : Nostalgia skin no more using isSysop() and isDeveloper() X-Git-Tag: 1.5.0alpha1~793 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=19b7c20006b9b4085ce60e64d744b488f1e8cc84;p=lhc%2Fweb%2Fwiklou.git Fix #913 : Nostalgia skin no more using isSysop() and isDeveloper() --- diff --git a/includes/Skin.php b/includes/Skin.php index 1b60a942b4..33b4a7e790 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -869,26 +869,29 @@ class Skin extends Linker { * @TODO crash bug913. Need to be rewrote completly. */ function specialPagesList() { - global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript; + global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights; require_once('SpecialPage.php'); $a = array(); $pages = SpecialPage::getPages(); + // special pages without access restriction foreach ( $pages[''] as $name => $page ) { $a[$name] = $page->getDescription(); } - if ( $wgUser->isSysop() ) - { - foreach ( $pages['sysop'] as $name => $page ) { - $a[$name] = $page->getDescription(); - } - } - if ( $wgUser->isDeveloper() ) - { - foreach ( $pages['developer'] as $name => $page ) { - $a[$name] = $page->getDescription() ; + + // Other special pages that are restricted. + // Copied from SpecialSpecialpages.php + foreach($wgAvailableRights as $right) { + if( $wgUser->isAllowed($right) ) { + /** Add all pages for this right */ + if(isset($pages[$right])) { + foreach($pages[$right] as $name => $page) { + $a[$name] = $page->getDescription(); + } + } } } + $go = wfMsg( 'go' ); $sp = wfMsg( 'specialpages' ); $spp = $wgContLang->specialPage( 'Specialpages' ); @@ -898,6 +901,7 @@ class Skin extends Linker { $s .= "